package com.wtwd.campus.constant;

/**
 * @author mjy
 * @date 2022/12/16
 * @description
 */
public enum DeviceAppFlagEnum {
    CLOSE(0, "关闭app", 2),
    OPEN(1, "开启", 3),
    FILE(4,"执行失败后开关的回退操作",4);
    private int flag;

    private String msg;

    /**
     * 待状态为数据下发未回复的状态
     */
    private int stayState;

    public int getStayState() {
        return stayState;
    }

    public void setStayState(int stayState) {
        this.stayState = stayState;
    }

    public int getFlag() {
        return flag;
    }

    public void setFlag(int flag) {
        this.flag = flag;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


    DeviceAppFlagEnum(int flag, String msg, int stayState) {
        this.flag = flag;
        this.msg = msg;
        this.stayState = stayState;
    }

    public static DeviceAppFlagEnum getDeviceAppFlagEnum(int flag) {
        for (DeviceAppFlagEnum value : DeviceAppFlagEnum.values()) {
            if (value.getFlag()==(flag)) {
                return value;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return "DeviceAppFlagEnum{" +
                "flag=" + flag +
                ", msg='" + msg + '\'' +
                ", stayState=" + stayState +
                '}';
    }


}
